import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


import Spacedetail from '@/components/business/OfficeSpace/spacedetail/SpaceDetail'
import Activitydetail from '@/components/business/activity/activitydetail/ActivityDetail'
import Financingdetail from '@/components/business/financing/financingdetail/FinancingDetail'
import Lawworksdetail from '@/components/business/lawworks/lawworksdetail/LawworksDetail'
import Preferendetail from '@/components/business/preferential/preferendetail/PreferenDetail'
import Tipsdetail from '@/components/business/tips/tipsdetail/TipsDetail'
import Taxationdetail from '@/components/business/taxation/taxationdetail/TaxationDetail'

import Home from  '@/components/home'

import Homepage from  '@/components/homepage/homepage'
import Housedetail from  '@/components/view/housedetail/Housedetail'

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      component: Home,
      redirect: '/home/homepage',
      meta:{
        title:'首页'
      }
    },
    {
      path:'/home/office/:cityid/:id',
      component: ()=> import(/* webpackChunkName: "Housedetail" */'@/components/view/housedetail/Housedetail'),
    },
    {
      path:'/home/office/:cityid/:id',
      component: Housedetail,
    },
    {
      path:'/home/business/officespace/spacedetail/:typeid/:id',
      component:Spacedetail,
    },
    {
      path:'/home/business/activity/activitydetail/:typeid/:id',
      component:Activitydetail,
    },
    {
      path:'/home/business/financing/financingdetail/:typeid/:id',
      component:Financingdetail,
    },
    {
      path:'/home/business/lawworks/lawworksdetail/:typeid/:id',
      component:Lawworksdetail,
    },
    {
      path:'/home/business/preferential/preferendetail/:typeid/:id',
      component:Preferendetail,
    },
    {
      path:'/home/business/tips/tipsdetail/:typeid/:id',
      component:Tipsdetail,
    },
    {
      path:'/home/business/taxation/taxationdetail/:typeid/:id',
      component:Taxationdetail,
    },
    {
      path: '/home',
      component: Home,
      redirect:"/home/homepage",
      children:[
        {
          path: '/home/homepage',
          component:Homepage,
        },
        {
          path: '/home/office/:id',
          name:'Office',
          meta:{
            title:'找办公空间'
          },
          component: ()=> import(/* webpackChunkName: "Office" */'@/components/Officespace/Office'),
        },
        {
          path: '/home/about',
          meta:{
            title:'关于我们'
          },
          component: ()=> import(/* webpackChunkName: "About" */'@/components/about/About'),
        },
        {
          path: '/home/contact',
          component: ()=> import(/* webpackChunkName: "Contact" */'@/components/contact/Contact'),
        },
        {
          path: '/home/owner',
          meta:{
            title:'业主'
          },
          component: ()=> import(/* webpackChunkName: "Owner" */'@/components/owner/Owner'),
        },
        {
          path: '/home/help',
          meta:{
            title:'帮助'
          },
          component:()=> import(/* webpackChunkName: "Help" */'@/components/help/Help'),
        },
        {
          path: '/home/business',
          component: ()=> import(/* webpackChunkName: "Business" */'@/components/business/Business'),
          redirect:"/home/business/whole",
          meta:{
            title:'租赁指南'
          },
          children:[
            {
              path:'/home/business/activity',
              component:()=> import(/* webpackChunkName: "Activity" */'@/components/business/activity/Activity'),
            },
            {
              path:'/home/business/financing',
              component:()=> import(/* webpackChunkName: "Financing" */'@/components/business/financing/Financing'),
            },
            {
              path:'/home/business/LawWorks',
              component:()=> import(/* webpackChunkName: "LawWorks" */'@/components/business/lawworks/LawWorks'),
            },
            {
              path:'/home/business/officespace',
              component:()=> import(/* webpackChunkName: "Officespace" */'@/components/business/OfficeSpace/Officespace'),
            },
            {
              path:'/home/business/taxation',
              component:()=> import(/* webpackChunkName: "Taxation" */'@/components/business/taxation/Taxation'),
            },
            {
              path:'/home/business/tips',
              component:()=> import(/* webpackChunkName: "Tips" */'@/components/business/tips/Tips'),
            },
            {
              path:'/home/business/whole',
              component:()=> import(/* webpackChunkName: "Whole" */'@/components/business/whole/Whole'),
            },
            {
              path:'/home/business/preferential',
              component:()=> import(/* webpackChunkName: "Preferential" */'@/components/business/preferential/Preferential'),
            },
          ]
        },
        
      ]
    },
  ]
})
